/*
 * @Description:
 * @Version: 2.0
 * @Author: Xing
 * @Date: 2020-12-08 12:02:36
 * @LastEditors: Xing
 * @LastEditTime: 2020-12-08 12:08:32
 */
import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export const constantRoutes = [
  {
    path: '/',
    redirect: '/index',
    component: () => import('@/views/index/index'),
  },
  {
    path: '/index',
    component: () => import('@/views/index/index'),
  },
];

const createRouter = () =>
  new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({
      y: 0,
    }),
    routes: constantRoutes,
  });

const router = createRouter();

export default router;
